package com.hycc.base;

import java.util.function.Predicate;

public class PerdicateDemo {
    public static void main(String[] args) {

        Predicate<String> a = new Predicate<String>() {
            @Override
            public boolean test(String s) {
                if (s.equals("a")) {
                    return true;
                }
                return false;
            }
        };

        System.out.println(a.test("a"));
        System.out.println(a.test("b"));

        Predicate<String> b = (str)->{return str.isEmpty();};

        System.out.println(b.test(""));
        System.out.println(b.test(" "));


    }
}
